package com.ddedu.controller;

import com.ddedu.common.JsonResult;
import com.ddedu.util.EmailUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
public class SendEmailController {

    @ResponseBody
    @PostMapping("/sendEmail.do")
    public JsonResult sendE(String email, String title, String text, HttpSession session){
//        Staff loginuser = (Staff)session.getAttribute("loginuser");
//        String sendemail = loginuser.getEmail();
        EmailUtil.sendEmail(email,title,text);
        return new JsonResult(1,null);
    }

}
